package com.mms.action.device;

import java.util.List;

import com.mms.dao.DeviceManagementDao;
import com.mms.entity.Device;
import com.opensymphony.xwork2.Action;

public class getDeviceAction implements Action{

	private int startpage;
	private List<Device> deviceMessage;
	private int account;

	
	public int getStartpage() {
		return startpage;
	}

	public void setStartpage(int startpage) {
		this.startpage = startpage;
	}

	public List<Device> getDeviceMessage() {
		return deviceMessage;
	}

	public void setDeviceMessage(List<Device> deviceMessage) {
		this.deviceMessage = deviceMessage;
	}

	public int getAccount() {
		return account;
	}

	public void setAccount(int account) {
		this.account = account;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		DeviceManagementDao ddm = new DeviceManagementDao();
		deviceMessage = ddm.getDevice(startpage);
		System.out.println(deviceMessage);
		account = ddm.getcount();
		return "success";
	}
}
